import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/ShouyeView.vue'
import permissionInit from './permission';
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
       meta:{
        title: '首页',
        // 标记是否需要登录-才能访问
        requirelogin: false,
        // 是否需要显示tabbar
        showTabbar: true,
      }
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),

    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Dengluyuzhuce/LoginView.vue'),
      meta:{
        title: '登录页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/reg',
      name: 'lreg',
      component: () => import('../views/Dengluyuzhuce/RegView.vue'),
      meta:{
        title: '注册页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/kaoshiliebiao',
      name: 'kaoshiliebiao',
      component: () => import('../views/Kaoshi/KaoshiliebiaoView.vue'),
      meta:{
        title: '考试列表页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/kaoshixiangqing',
      name: 'kaoshixiangqing',
      component: () => import('../views/Kaoshi/KaoshixiangqingView.vue'),
      meta:{
        title: '考试详情页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/datijindu',
      name: 'datijindu',
      component: () => import('../views/Kaoshi/DatijinduView.vue'),
      meta:{
        title: '答题进度页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/zhenzaidati',
      name: 'zhenzaidati',
      component: () => import('../views/Kaoshi/ZhenzaidatiView.vue'),
      meta:{
        title: '正在答题页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/kaoshijieguo',
      name: 'kaoshijieguo',
      component: () => import('../views/Kaoshi/KaoshixiangqingView.vue'),
      meta:{
        title: '考试结果页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/ribaoguangli',
      name: 'ribaoguangli',
      component: () => import('../views/Ribao/RibaoguangliView.vue'),
      meta:{
        title: '日报管理页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/ribaobianji',
      name: 'ribaobianji',
      component: () => import('../views/Ribao/RibaobianjiView.vue'),
      meta:{
        title: '日报编辑页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/wodeshouchang',
      name: 'wodeshouchang',
      component: () => import('../views/Ribao/WodeshouchangView.vue'),
      meta:{
        title: '我的收藏页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/wodedianzang',
      name: 'wodedianzang',
      component: () => import('../views/Ribao/WodedianzangView.vue'),
      meta:{
        title: '我的点赞页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/wodehuifu',
      name: 'wodehuifu',
      component: () => import('../views/Ribao/WodehuifuView.vue'),
      meta:{
        title: '我的回复页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/xiaoneiluntang',
      name: 'xiaoneiluntang',
      component: () => import('../views/Xiaoneiluntang/XiaoneiluntangView.vue'),
      meta:{
        title: '校内论坛页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/luntangxiangqing',
      name: 'luntangxiangqing',
      component: () => import('../views/Xiaoneiluntang/LuntangxiangqingView.vue'),
      meta:{
        title: '论坛详情页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/pinglunliebiao',
      name: 'pinglunliebiao',
      component: () => import('../views/Xiaoneiluntang/PinglunliebiaoView.vue'),
      meta:{
        title: '评论列表页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/luntangfatie',
      name: 'luntangfatie',
      component: () => import('../views/Xiaoneiluntang/LuntangfatieView.vue'),
      meta:{
        title: '论坛发帖页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/gerenshezhi',
      name: 'gerenshezhi',
      component: () => import('../views/Geren/GerenshezhiView.vue'),
      meta:{
        title: '个人设置页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/gerenzhongxin',
      name: 'gerenzhongxin',
      component: () => import('../views/Geren/GerenzhongxinView.vue'),
      meta:{
        title: '个人中心页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/sousuo',
      name: 'sousuo',
      component: () => import('../views/Sousuo/SousuoView.vue'),
      meta:{
        title: '搜索页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
    {
      path: '/cuowuyemian',
      name: 'cuowuyemian',
      component: () => import('../views/Sousuo/CuowuyemianView.vue'),
      meta:{
        title: '404错误页',
        // requirelogin: true,
        // showTabbar: false,
      }
    },
  ],
})
// 处理页面权限
permissionInit(router);
export default router
